package cn.cdeden.knowledge.controller.online.factory.jurisdiction;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ProjectName : ecm_hou
 * @Package : com.cdyd.ecm.file.jurisdiction
 * @ClassName : FactoryProducterJurisdiction
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2022/9/28 17:15
 * @Version : 1.0
 */
@Component
public class JurisdictionFactory {

    @Autowired
    private Map<String, Jurisdiction> jurisdictionMap;

    public Jurisdiction getJurisdiction(String jurisdiction){
        if (!jurisdictionMap.containsKey(jurisdiction)) {
            throw new RuntimeException("类型不存在,错误的请求类型");
        }
        return  jurisdictionMap.get(jurisdiction);
    }

}
